using System;
using System.ServiceProcess;
using Driven.ProcessScheduler.WindowsService.Lib;

namespace Driven.ProcessScheduler.WindowsService
{
    static class Program
    {
        static void Main()
        {
            try
            {
                var container = ContainerConfigurator.CreateContainer();

                var ServicesToRun = new ServiceBase[] { container.Resolve<SchedulingEngine>() };

                ServiceBase.Run(ServicesToRun);
            }
            catch (Exception ex)
            {
                var sl = new SimpleLogger(SimpleLogger.SimpleLoggerType.EventLog, "Driven.ProcessScheduler", string.Empty, 0);
                sl.Log(ex);
            }
        }
    }
}